//package com.luo.stock.listener;
//
//
//import com.github.benmanes.caffeine.cache.Cache;
//import com.luo.stock.service.StockService;
//import lombok.extern.slf4j.Slf4j;
//import org.joda.time.DateTime;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.util.Date;
//
///**
// * @Description
// * @Author 奥观海
// * @Date 2024/9/20
// */
//@Component
//@Slf4j
//public class MqListener {
//    @Autowired
//    private Cache<String,Object> cache;
//    @Autowired
//    private StockService stockService;
//    @RabbitListener(queues = "innerMarketQueue")
//    public void caCheInnerMarketQueue(Date date){
//        long l = DateTime.now().getMillis() - new DateTime(date).getMillis();
////        if(l>60000){
////            log.error("采集国内大盘时间点：{},同步超时：{}ms",new DateTime(date).toString("yyyy-MM-dd HH:mm:ss"),date);
////        }
//        cache.invalidate("innerMarketInfosKey");
//        stockService.getIndexAll();
//    }
//    @RabbitListener(queues = "outerMarketQueue")
//    public void caCheouterMarketQueue(Date date){
//        long l = DateTime.now().getMillis() - new DateTime(date).getMillis();
////        if(l>60000){
////            log.error("采集国外大盘时间点：{},同步超时：{}ms",new DateTime(date).toString("yyyy-MM-dd HH:mm:ss"),date);
////        }
//        cache.invalidate("outerMarketKey");
//        stockService.getOuterMarket();
//    }
//    @RabbitListener(queues = "innerStockBlockQueue")
//    public void caCheinnerStockBlockQueue(Date date){
//        long l = DateTime.now().getMillis() - new DateTime(date).getMillis();
////        if(l>60000){
////            log.error("采集国内板块时间点：{},同步超时：{}ms",new DateTime(date).toString("yyyy-MM-dd HH:mm:ss"),date);
////        }
//        cache.invalidate("innerStockBlockKey");
//        stockService.getSectorAll();
//    }
//    @RabbitListener(queues = "innerStockQueue")
//    public void caCheinnerStockQueue(Date date){
//        long l = DateTime.now().getMillis() - new DateTime(date).getMillis();
////        if(l>60000){
////            log.error("采集国内股票时间点：{},同步超时：{}ms",new DateTime(date).toString("yyyy-MM-dd HH:mm:ss"),date);
////        }
//        cache.invalidate("innerStockKey");
//        stockService.getStockPage(0,0);
//    }
//}
